package me.ywd.api;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.cloud.netflix.zuul.filters.discovery.PatternServiceRouteMapper;
import org.springframework.context.annotation.Bean;

/**
 * @Author Ye_Wenda
 * @Date 11/6/2017
 */
@EnableZuulProxy
@SpringBootApplication
public class ApiApp {

    @Bean
    public PatternServiceRouteMapper patternServiceRouteMapper(){
        return new PatternServiceRouteMapper("(?<name>^.+)-(?<version>v.+$)","${version}/${name}");
    }

    public static void main(String[] args) {
        SpringApplication.run(ApiApp.class, args);
    }
}
